package com.xiaowu.datajpa.exception;

import com.xiaowu.datajpa.constant.ResultEnum;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class ResultException extends RuntimeException{
    private Integer code;

    public ResultException(Integer code,String msg)
    {
        super(msg);
        this.code=code;
    }
    public ResultException(ResultEnum resultEnum)
    {
        super(resultEnum.getMsg());
        this.code=resultEnum.getCode();
    }
}
